/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Login.java
 *
 * Created on 12-mei-2009, 20:46:55
 */

package Gui.login;

import importexport.Import;

import java.io.File;

import Gui.GoogleDocsImportExport;
import Gui.NewJFrame;

//import Gui.NewJFrame;
import main.Main;

/**
 *
 * @author LESLEY
 */
public class Login extends javax.swing.JFrame {

    /** Creates new form Login */
    public Login() {

        initComponents();
        
        pack();
        setLocationRelativeTo(null);

        setDefaultCloseOperation(EXIT_ON_CLOSE);

        existingUserPaneHeight = existingUserPane.getHeight() + 5;
        initLoginPanel();
        initFileChooser();
    }

    private final void initFileChooser() {
        localFileChooser.setMultiSelectionEnabled(true);
        localFileChooser.setAcceptAllFileFilterUsed(false);
        localFileChooser.setDialogTitle("USIM Pro - Lokaal bestand zoeken...");
        localFileChooser.addChoosableFileFilter(new ZipFileFilter());
    }

    private final void initLoginPanel() {
        // initialize LoginPanel without the existingUserPane on it
        importOpen = false;
        existingUserPane.setVisible(false);
        setSize(getWidth(), getHeight() - existingUserPane.getHeight());
    }

    private final void setConnection(String dbName, String username,
            String password) {
        if (!Main.initConnection(dbName, username, password)) {
            // TODO popup window (kon geen verbinding maken)
        } else {
            dispose();
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        localFileChooser = new javax.swing.JFileChooser();
        loginPanel = new javax.swing.JPanel();
        newUserButton = new javax.swing.JButton();
        cancelButton = new javax.swing.JButton();
        loginButton = new javax.swing.JButton();
        loginPasswordText = new javax.swing.JPasswordField();
        loginUsernameText = new javax.swing.JTextField();
        loginUsernameLabel = new javax.swing.JLabel();
        loginPasswordLabel = new javax.swing.JLabel();
        advancedButton = new javax.swing.JButton();
        rememberCheckBox = new javax.swing.JCheckBox();
        existingUserPane = new javax.swing.JTabbedPane();
        localFilePanel = new javax.swing.JPanel();
        localFileBrowseButton = new javax.swing.JButton();
        localFileLabel = new javax.swing.JLabel();
        localFileText = new javax.swing.JTextField();
        localFileFetchButton = new javax.swing.JButton();
        onlinePanel = new javax.swing.JPanel();
        onlineUsernameText = new javax.swing.JTextField();
        onlinePasswordText = new javax.swing.JPasswordField();
        onlineUsernameLabel = new javax.swing.JLabel();
        onlineLabel = new javax.swing.JLabel();
        onlinePasswordLabel = new javax.swing.JLabel();
        onlineFileFetchButton = new javax.swing.JButton();
        onlineComboBox = new javax.swing.JComboBox();

        localFileChooser.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                localFileChooserActionPerformed(evt);
            }
        });

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("USIM Pro - Login");
        setResizable(false);

        loginPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Login", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(0, 0, 0))); // NOI18N

        newUserButton.setText("Nieuwe gebruiker");
        newUserButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                newUserButtonActionPerformed(evt);
            }
        });

        cancelButton.setText("Annuleren");
        cancelButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancelButtonActionPerformed(evt);
            }
        });

        loginButton.setText("Login");
        loginButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                loginButtonActionPerformed(evt);
            }
        });

        loginUsernameLabel.setText("Gebruikersnaam: ");

        loginPasswordLabel.setText("Wachtwoord: ");

        advancedButton.setText("Geavanceerd >>");
        advancedButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                advancedButtonActionPerformed(evt);
            }
        });

        rememberCheckBox.setSelected(true);
        rememberCheckBox.setText("Mij onthouden");
        rememberCheckBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rememberCheckBoxActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout loginPanelLayout = new javax.swing.GroupLayout(loginPanel);
        loginPanel.setLayout(loginPanelLayout);
        loginPanelLayout.setHorizontalGroup(
            loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, loginPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(loginPanelLayout.createSequentialGroup()
                        .addComponent(advancedButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 100, Short.MAX_VALUE)
                        .addComponent(loginButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(cancelButton))
                    .addGroup(loginPanelLayout.createSequentialGroup()
                        .addComponent(rememberCheckBox)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 151, Short.MAX_VALUE)
                        .addComponent(newUserButton))
                    .addGroup(loginPanelLayout.createSequentialGroup()
                        .addGroup(loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(loginUsernameLabel)
                            .addComponent(loginPasswordLabel))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(loginPasswordText, javax.swing.GroupLayout.DEFAULT_SIZE, 271, Short.MAX_VALUE)
                            .addComponent(loginUsernameText, javax.swing.GroupLayout.DEFAULT_SIZE, 271, Short.MAX_VALUE))))
                .addContainerGap())
        );
        loginPanelLayout.setVerticalGroup(
            loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(loginPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(loginUsernameLabel)
                    .addComponent(loginUsernameText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(loginPasswordLabel)
                    .addComponent(loginPasswordText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(newUserButton)
                    .addComponent(rememberCheckBox))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(loginButton)
                    .addComponent(cancelButton)
                    .addComponent(advancedButton))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        existingUserPane.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Bestaande gebruiker", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(0, 0, 0))); // NOI18N

        localFileBrowseButton.setText("Bladeren...");
        localFileBrowseButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                localFileBrowseButtonActionPerformed(evt);
            }
        });

        localFileLabel.setText("Lokaal bestand: ");

        localFileFetchButton.setText("Login met bestand");
        localFileFetchButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                localFileFetchButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout localFilePanelLayout = new javax.swing.GroupLayout(localFilePanel);
        localFilePanel.setLayout(localFilePanelLayout);
        localFilePanelLayout.setHorizontalGroup(
            localFilePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(localFilePanelLayout.createSequentialGroup()
                .addGroup(localFilePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, localFilePanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(localFileLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(localFileText, javax.swing.GroupLayout.DEFAULT_SIZE, 178, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(localFileBrowseButton))
                    .addComponent(localFileFetchButton))
                .addContainerGap())
        );
        localFilePanelLayout.setVerticalGroup(
            localFilePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, localFilePanelLayout.createSequentialGroup()
                .addContainerGap(40, Short.MAX_VALUE)
                .addGroup(localFilePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(localFileLabel)
                    .addComponent(localFileText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(localFileBrowseButton))
                .addGap(36, 36, 36)
                .addComponent(localFileFetchButton)
                .addContainerGap())
        );

        existingUserPane.addTab("Lokaal bestand", localFilePanel);

        onlineUsernameLabel.setText("Gebruikersnaam: ");

        onlineLabel.setText("Online: ");

        onlinePasswordLabel.setText("Wachtwoord: ");

        onlineFileFetchButton.setText("Bestand ophalen");
        onlineFileFetchButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                onlineFileFetchButtonActionPerformed(evt);
            }
        });

        onlineComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Google Docs" }));

        javax.swing.GroupLayout onlinePanelLayout = new javax.swing.GroupLayout(onlinePanel);
        onlinePanel.setLayout(onlinePanelLayout);
        onlinePanelLayout.setHorizontalGroup(
            onlinePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(onlinePanelLayout.createSequentialGroup()
                .addGroup(onlinePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, onlinePanelLayout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addGroup(onlinePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(onlinePanelLayout.createSequentialGroup()
                                .addComponent(onlineLabel)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(onlineComboBox, 0, 220, Short.MAX_VALUE)
                                .addGap(93, 93, 93))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, onlinePanelLayout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addGroup(onlinePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(onlineUsernameLabel)
                                    .addComponent(onlinePasswordLabel))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(onlinePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(onlinePasswordText, javax.swing.GroupLayout.DEFAULT_SIZE, 256, Short.MAX_VALUE)
                                    .addComponent(onlineUsernameText, javax.swing.GroupLayout.DEFAULT_SIZE, 256, Short.MAX_VALUE)))))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, onlinePanelLayout.createSequentialGroup()
                        .addContainerGap(251, Short.MAX_VALUE)
                        .addComponent(onlineFileFetchButton)))
                .addContainerGap())
        );
        onlinePanelLayout.setVerticalGroup(
            onlinePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(onlinePanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(onlinePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(onlineLabel)
                    .addComponent(onlineComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(onlinePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(onlineUsernameLabel)
                    .addComponent(onlineUsernameText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(onlinePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(onlinePasswordLabel)
                    .addComponent(onlinePasswordText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 11, Short.MAX_VALUE)
                .addComponent(onlineFileFetchButton)
                .addContainerGap())
        );

        existingUserPane.addTab("Online diensten", onlinePanel);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(existingUserPane, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 395, Short.MAX_VALUE)
                    .addComponent(loginPanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(loginPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(existingUserPane, javax.swing.GroupLayout.PREFERRED_SIZE, 191, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents
        
    private void loginButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_loginButtonActionPerformed
        // geef login en paswoord door + sluit venster
        String username = loginUsernameText.getText();
        String password = loginPasswordText.getText();
        String dbName = "";
        if ((username == null) || (password == null) || 
        		username.isEmpty() || password.isEmpty()) {
            // TODO popup window -> username and password needed!
        	return;
        }
        try {
            dbName = Main.userDB.getDBFilename(username, password);
        } catch (Exception e) {
        	
            /** TODO !!!!!!!! popup window + keer terug naar login panel (foute login) */
        	
            loginUsernameText.setText("");
            loginPasswordText.setText("");
            return;
        }
        if ((dbName != null) && (!dbName.isEmpty())) {
        	setConnection(dbName, username, password);
        	try {
				NewJFrame.main(null);
			} catch (Exception e) {
				// TODO unexpected error!!!
				e.printStackTrace();
			}
        } else {
        	// TODO popup window -> onverwachte error!
        }
    }//GEN-LAST:event_loginButtonActionPerformed

    private void advancedButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_advancedButtonActionPerformed
        
        if (importOpen) {
            existingUserPane.setVisible(false);
            setSize(getWidth(), getHeight() - existingUserPaneHeight);
            advancedButton.setText("Geavanceerd >>");
        	importOpen = false;
        } else {
            setSize(getWidth(), getHeight() + existingUserPaneHeight);
            existingUserPane.setVisible(true);
            advancedButton.setText("Geavanceerd <<");
            importOpen = true;
        }
    }//GEN-LAST:event_advancedButtonActionPerformed

    private void newUserButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newUserButtonActionPerformed
        NewUser.main(null);
    }//GEN-LAST:event_newUserButtonActionPerformed

    private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
        dispose();
    }//GEN-LAST:event_cancelButtonActionPerformed

    private void localFileBrowseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_localFileBrowseButtonActionPerformed
        localFileChooser.showOpenDialog(this);
    }//GEN-LAST:event_localFileBrowseButtonActionPerformed

    private void localFileFetchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_localFileFetchButtonActionPerformed
        if ((localFiles != null) && (localFiles.length > 0)) {
	    	for (int i = 0; i < localFiles.length; i++) {
	            try {
					Import.importZip(localFiles[i].getAbsolutePath());
				} catch (Exception e) {
					// TODO remove
					e.printStackTrace();
					return;
				}
	        }
	        loginButtonActionPerformed(evt);
        }
    }//GEN-LAST:event_localFileFetchButtonActionPerformed

    private void onlineFileFetchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_onlineFileFetchButtonActionPerformed
        // bestand importeren
    	String username = onlineUsernameText.getText();
        String password = onlinePasswordText.getText();
        if ((username == null) || (password == null) || 
        		username.isEmpty() || password.isEmpty()) {
            // TODO popup window -> username and password needed!
        	onlineUsernameText.setText("");
        	onlineUsernameText.setText("");
        	return;
        }
    	GoogleDocsImportExport gd = new GoogleDocsImportExport(true);
    	gd.loginImport = true;
    	gd.setLoginData(username, password);
    	gd.searchButtonActionPerformed(evt);
    	gd.loginPanel.setVisible(false);
    	gd.setSize(gd.getWidth(), gd.getHeight() - gd.loginPanelHeight);
    	gd.setVisible(true);
    	
    }//GEN-LAST:event_onlineFileFetchButtonActionPerformed

    private void localFileChooserActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_localFileChooserActionPerformed
        localFiles = localFileChooser.getSelectedFiles();
        String filenames = "";
        for (int i = 0; i < localFiles.length - 1; i++) {
            filenames += "\"" + localFiles[i].getName() + "\"; ";
        }
        if (localFiles.length > 0) {
            filenames += "\"" + localFiles[localFiles.length - 1].getName()+ "\"";
        }
        localFileText.setText(filenames);
        if (localFiles.length <= 1) {
            localFileFetchButton.setText("Login met bestand");
        }
        if (localFiles.length > 1) {
            localFileFetchButton.setText("Login met bestanden");
        }
    }//GEN-LAST:event_localFileChooserActionPerformed

    private void rememberCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rememberCheckBoxActionPerformed
        if (Main.save) {
            Main.save = false;
        } else {
            Main.save = true;
        }
    }//GEN-LAST:event_rememberCheckBoxActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Login().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton advancedButton;
    private javax.swing.JButton cancelButton;
    private javax.swing.JTabbedPane existingUserPane;
    private javax.swing.JButton localFileBrowseButton;
    private javax.swing.JFileChooser localFileChooser;
    private javax.swing.JButton localFileFetchButton;
    private javax.swing.JLabel localFileLabel;
    private javax.swing.JPanel localFilePanel;
    private javax.swing.JTextField localFileText;
    private javax.swing.JButton loginButton;
    private javax.swing.JPanel loginPanel;
    private javax.swing.JLabel loginPasswordLabel;
    private javax.swing.JPasswordField loginPasswordText;
    private javax.swing.JLabel loginUsernameLabel;
    private javax.swing.JTextField loginUsernameText;
    private javax.swing.JButton newUserButton;
    private javax.swing.JComboBox onlineComboBox;
    private javax.swing.JButton onlineFileFetchButton;
    private javax.swing.JLabel onlineLabel;
    private javax.swing.JPanel onlinePanel;
    private javax.swing.JLabel onlinePasswordLabel;
    private javax.swing.JPasswordField onlinePasswordText;
    private javax.swing.JLabel onlineUsernameLabel;
    private javax.swing.JTextField onlineUsernameText;
    private javax.swing.JCheckBox rememberCheckBox;
    // End of variables declaration//GEN-END:variables
    private boolean importOpen;
    private final int existingUserPaneHeight;
    private File[] localFiles;
    private File[] onlineFiles;
}
